//
//  ZYAudientListGeneralizeCell.m
//  AudientList
//
//  Created by zhangweiwei on 16/6/15.
//  Copyright © 2016年 Erica. All rights reserved.
//

#import "ZYAudientListGeneralizeCell.h"
#import "YYWebImage.h"
#import "KCCategory.h"


CGFloat const ZYAudientListGeneralizeCellHeight = 65;
NSString  *const ZYAudientListGeneralizeCellReuseID = @"ZYAudientListGeneralizeCell";

@interface ZYAudientListGeneralizeCell ()

@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *introLabel;


@end

@implementation ZYAudientListGeneralizeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setAudientListModel:(ZYAudientListModel *)audientListModel
{
    _audientListModel = audientListModel;
    
    self.nameLabel.text = audientListModel.username;
    
    self.introLabel.attributedText = audientListModel.detailIntroAttributedString;
    
    [self.iconView yy_setImageWithURL:[NSURL URLWithString:audientListModel.originPic] placeholder:nil options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
        
        self.iconView.image = [image kc_circleImage];
    }];
    
}

@end
